package com.yyjj.my;

import android.app.Dialog;
import android.content.Context;


public class DialogUtil {

    private static DialogUtil mDialogUtil;

    public static DialogUtil getInstance(){
        if (mDialogUtil == null){
            mDialogUtil = new DialogUtil();
        }
        return mDialogUtil;
    }

    Dialog reportDialog;

    public void showReportDialogDialog(Context context) {
//        reportDialog = new Dialog(context, R.style.ReportDialogStyle);
//        View view = LayoutInflater.from(context).inflate(R.layout.pop_report_window_layout, null);
//        reportDialog.setCanceledOnTouchOutside(true);
//        reportDialog.setContentView(view);
//        Window dialogWindow = reportDialog.getWindow();
//        dialogWindow.setGravity(Gravity.BOTTOM);
//        dialogWindow.setWindowAnimations(R.style.BottomDialogAnimation);
//        WindowManager.LayoutParams lp = dialogWindow.getAttributes();
//        lp.width =getScreenWidth(context);
//        dialogWindow.setAttributes(lp);
//        final CheckBox cb1 = view.findViewById(R.id.cb1);
//        final CheckBox cb2 = view.findViewById(R.id.cb2);
//        final CheckBox cb3 = view.findViewById(R.id.cb3);
//        final CheckBox cb4 = view.findViewById(R.id.cb4);
//        final CheckBox cb5 = view.findViewById(R.id.cb5);
//        final CheckBox cb6 = view.findViewById(R.id.cb6);
//        final CheckBox cb7 = view.findViewById(R.id.cb7);
//        final CheckBox cb8 = view.findViewById(R.id.cb8);
//        final CheckBox cb9 = view.findViewById(R.id.cb9);
//        view.findViewById(R.id.cancel).setOnClickListener(new OnNoDoubleClickListener() {
//            @Override
//            public void onNoDoubleClick(View v) {
//                reportDialog.dismiss();
//                reportDialog.cancel();
//            }
//        });
//        view.findViewById(R.id.commit).setOnClickListener(new OnNoDoubleClickListener() {
//            @Override
//            public void onNoDoubleClick(View v) {
//                if (cb1.isChecked()||cb2.isChecked()||cb3.isChecked()||cb4.isChecked()||cb5.isChecked()||cb6.isChecked()
//                        ||cb7.isChecked()||cb8.isChecked()||cb9.isChecked()){
//                    reportDialog.dismiss();
//                    ToastUtil.show(R.string.commit_report_hint);
//                }else {
//                    ToastUtil.show(R.string.report_cancel_hint);
//                }
//            }
//        });
//        reportDialog.show();
    }
}
